#一次排序函数
def paixu(list1,left,right):
    r = right
    l = left
    s = list1[left]
    r1=1
    l1=0
    while r>l:
        if r1:
           if list1[r]>=s:
               r-=1
           else:
               list1[l]=list1[r]
               r1=0
               l1=1
               l+=1
        if l1:
           if list1[l]<=s:
               l+=1
           else:
               list1[r]=list1[l]
               l1=0
               r1=1
               r-=1
    list1[r]=s
    pp=r
    return pp

#循环递归
def xunhuan(list,l,r):
    if l<r:
        p=paixu(list,l,r)

        xunhuan(list,l,p-1)
        xunhuan(list,p+1,r)

#主要运行界面！
lst=[10,5,8,87,4,125,457,459,0,2,54,23,7854,4,15,2,4,7,5,6]
xunhuan(lst,0,len(lst)-1)
print(lst)





